# -*- coding: utf-8 -*-


from project.app import project_app

import logging

logger = logging.getLogger(__file__)

inspect = project_app.control.inspect()
if not inspect:
    logger.info('inspect is None')

def get_inspect():

    logger.info(inspect.report())
    logger.info(inspect.stats())
    logger.info(inspect.ping())


def get_running_tasks():
    for worker, tasks in inspect.active().items():
        for task in tasks:
            logger.info(f'Worker {worker} running Task:{task}')
